import { Router } from 'express'
import { find } from '../../db/dao'
import { USER } from '../../db/model'

const router = Router()

router.get('/listpwd', (req, res) => {
  const { account } = req.body
  // 密码匹配
  const id = account ? find(USER, { account }) : find(USER)
  id.then(data => {
    res.status(200).json(data)
  }).catch(() => {
    res.status(500).end()
  })
})

export default router
